import java.lang.reflect.Method;
class Run
{

    private String source = "";
    private String fullName = "";

    public Run(){

    }

    public void setSource(String str){
        this.source = str;
        getFullName(str);
    }

    private void getFullName(String str){
        this.fullName = "";
    }

    public String runProgram(){
        try
        {
            DynamicEngine de = DynamicEngine.getInstance();
            Object instance =  de.javaCodeToObject(fullName,source.toString());
            Method method = instance.getClass().getMethod("main", String[].class);
            method.invoke(instance, new Object[]{ new String[]{""}});
        }
        catch(Exception e){

        }
        return "";
    }


    public static void main(String[] args) throws Exception {
        String fullName = "DynaClass";
        StringBuilder src = new StringBuilder();

        
        src.append("public class DynaClass {\n");
        src.append("    public static void main(String[] s) {\n");
        src.append("        System.out.println(\"hello world!?????\");\n");
        src.append("    }\n");
        src.append("}\n");


        System.out.println(src);
        DynamicEngine de = DynamicEngine.getInstance();
        Object instance =  de.javaCodeToObject(fullName,src.toString());
        Method method = instance.getClass().getMethod("main", String[].class);
        method.invoke(instance, new Object[]{ new String[]{""}});

    }
}
